package org.example;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

/**
 * ClassName: AOPTest01
 * Package: org.example
 * Description:
 *
 * @Author wanghao
 * @Create 2024-07-08 10:08
 * @Version 1.0
 */
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration("classpath:applicationContext.xml")
public class AOPTest01 {

    @Autowired
    private ISale iSale;

    //@Autowired
    //private WuDa2 wuDa2;

    //@Autowired
    //private WuDa3 wuDa3;

    @Test
    public void test01() {
//        iSale.saleShaoBing();
//        iSale.saleJuice();
        iSale.saleYueBing();
    }

    @Test
    public void test02() {
        //wuDa2.saleShaoBing();
    }

    @Test
    public void test03() {
        //wuDa3.saleShaoBing();
    }

    // 演示获取连接点信息
    @Test
    public void test04() {
        iSale.saleShaoBing();
    }

    // 演示在增强方法中使用目标方法的返回值
    @Test
    public void test05() {

        iSale.saleJianBing();
    }

    // 演示在增强方法中使用目标方法的异常信息
    @Test
    public void test06() {

        iSale.saleShaoBing();
    }
}
